package com.topisv.tms.repository.pickCar;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.topisv.tms.entity.pickCar.PickCar;

/**
 * 拣货车_DAO
 * @author ch
 *
 */
public abstract interface PickCarDao extends PagingAndSortingRepository<PickCar, Long>, JpaSpecificationExecutor<PickCar>
{

	@Query("select t from PickCar t where t.customerCode=?1 and t.warehouseCode=?2 and t.status=?3")
	List<PickCar> loadCar(String customerCode, String warehouseCode,
			String status);

	@Query("select t from PickCar t where t.customerCode=?1 and t.warehouseCode=?2 and t.carCode=?3")
	PickCar loadCarByCondition(String customerCode, String warehouseCode,String carCode);

	@Query("select t from PickCar t where t.carCode=?")
	PickCar loadCarByCode(String carCode);

}